package me.sealer.algorithm.hash.node;

/**
 * @author sealer
 * @date 2018/06/04.
 * @email 1178884049@qq.com
 */
public class DefaultClientNode extends AbstractClientNode {
    private RealServerNode realServerNode;

    public DefaultClientNode(String host, int port) {
        super(host, port);
    }

    public DefaultClientNode(String host, int port, RealServerNode realServerNode) {
        this(host, port);
        this.realServerNode = realServerNode;
    }

    @Override
    public RealServerNode getRealServerNode() {
        return this.realServerNode;
    }

    @Override
    public void setRealServerNode(RealServerNode realServerNode) {
        this.realServerNode = realServerNode;
    }

    @Override
    public String genHashKey() {
        return this.host + ":" + this.port;
    }

    @Override
    public String toString() {
        return "DefaultClientNode{" +
                "realServerNode=" + realServerNode +
                ", host='" + host + '\'' +
                ", port=" + port +
                '}';
    }
}
